x86/HVM: only allow ring 0 guest code to make hypercalls
authorJan Beulich <jbeulich@suse.com>
Wed, 27 Nov 2013 08:01:49 +0000 (09:01 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 27 Nov 2013 08:01:49 +0000 (09:01 +0100)
Anything else would allow for privilege escalation.

This is CVE-2013-4554 / XSA-76.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/x86/hvm/hvm.c

index af249f7543c33852bce3f4feb6c915afb7a56b79..e2ba9ded0c7fc4f91b40ef3c4e5a3671eb904f22 100644 (file)
@@ -3468,7 +3468,7 @@ int hvm_do_hypercall(struct cpu_user_regs *regs)
     case 4:
     case 2:
         hvm_get_segment_register(curr, x86_seg_ss, &sreg);
-        if ( unlikely(sreg.attr.fields.dpl == 3) )
+        if ( unlikely(sreg.attr.fields.dpl) )
         {
     default:
             regs->eax = -EPERM;